<template>
  <div>
    <h3>测试用组件</h3>
    <p v-abc>{{uname}}</p>
  </div>
</template>

<script>
export default {
  props:['uname'],
  directives: {
    abc: {
      bind(el) {
        el.style.color = 'pink'
      },
      update(el) {
        console.log(el.innerHTML) //uname更新前的值
      },
      componentUpdated(el) {
        console.log(el.innerHTML)  //uname更新后的值
      }
    }
  }
}
</script>

<style>

</style>